package com.ryh.constant;

/**
 * 角色类型
 * @author rao
 */
public enum RoleEnum {
    /**
     * ADMIN:管理员
     */
    ADMIN("admin"),
    /**
     * USER：普通用户
     */
    USER("user");

    String role;

    RoleEnum(String role) {
        this.role = role;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }
    public static String value(String value) {

        if ("".equals(value) || value == null) {
            return "";
        } else {
            for (RoleEnum re : RoleEnum.values()) {
                if (re.getRole() == value) {
                    return re.getRole();
                }
            }
            return "";
        }
    }
}
